package leetcode_数组.leetcode_数组的改变和移动;

import java.util.Arrays;

public class _453 {
    public static void main(String[] args) {
        int[] ints = {1, 2, 3};
        System.out.println(minMoves(ints));
    }

    public static int minMoves(int[] nums) {
        int ans = 0;
        Arrays.sort(nums);
        for (int i = 1; i < nums.length; i++) {
            ans += nums[i] - nums[0];
        }
        return ans;
    }

}
